<template>
    <div class="home">
        <div class="home-swiper">
            <mt-swipe :auto="4000">
                <mt-swipe-item 
                    v-for="img in swiperImgs"
                    :key="img.id">
                    <img :src="img.url" alt="轮播图">
                </mt-swipe-item>
            </mt-swipe>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'Home',
        data(){
            return{
                swiperImgs: []
            }
        },
        created(){
            this.$http.getHomeswiper()
            .then(res => {
                this.swiperImgs = res.imgs
            })
        }
    }
</script>

<style scoped lang="scss">
    .home-swiper{
        width: 100%;
        height: 200px;
        .mint-swipe{
            height: 200px;
            text-align: center;
            background-color: red;
            img{
                width: 100%;
                height: 200px;
            }
        }
    }
</style>
